package com.taiyuan.zfmvp.kafka.service.impl;

import com.taiyuan.zfmvp.kafka.service.ProducerService;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @param request
 * @Author: zhoufang@si-tech.com.cn
 * @Descriiption:
 * @Date 2022/2/14
 * @return
 */
@Service
public class ProducerServiceImpl implements ProducerService {

    @Resource
    private KafkaTemplate<String, String> kafkaTemplate;

    @Override
    public void sendMessage(String topic, String msg) {
        kafkaTemplate.send(topic,msg);
    }
}
